/**
* 
* ====================================================================
*
* @author apov <apov@ymail.com>
*/ 
#pragma once

#include <BaseDefine.h>
#include "DBLibs.h"
#include "DBStatement.h"

/**
* @class DBSession
*  - 
*/
class DBError;
class DBSession{
public:
	virtual void set_error( void* data, char* sql, char* method, int line ) = 0;
	virtual DBError* get_error() = 0;
	virtual DBStatement* get_statement() = 0;
	virtual void reset() = 0;

	virtual int connect() = 0;
	virtual int reconnect() = 0;
	virtual int isActive() = 0;
	virtual int disconnect() = 0;
	virtual bool setTimeout( size_t timeout ){ return true; }
	
	virtual int get_table_desc( void* handle, char* table_name, DBTableDescription& desc ) = 0;	

	DBAccount* getAccount();

	DBSession( DBAccount& account );
	virtual ~DBSession();

protected:
	DBAccount account_;

private:
};
